{# empty Twig template #}
{# empty Twig template #}

{% extends'CNAMActimanBundle::layoutBody.html.twig' %}
       
        
        
{% block body %}


    {% block content %}

        <div class="row">
            <div class="col-lg-12">
                <h2><center>{{ procedureplan.acProcedure.nomProcedure }}</center></h2>
            </div>
            <div class="col-lg-12">
                <hr align="center" width="90%" size="5">
                <h3><small>Responsable Procédure : {{ procedureplan.acProcedure.user.nomUser }} {{ procedureplan.acProcedure.user.prenomUser }}
                    <br>Date de création : {{ procedureplan.acProcedure.dateCreation|date('d-m-Y') }}
                    <br>Date de modification : {{ procedureplan.acProcedure.dateModification|date('d-m-Y') }}
                    <br>Service : {{ procedureplan.acProcedure.service.nomService }}
                    <br>Date de début de la Procédure : {{ procedureplan.dateDebutProc|date('d-m-Y') }}
                    <br>Date de fin de la Procédure : {{ procedureplan.dateFinProc|date('d-m-Y') }}
                    <br>Période : {{ procedureplan.periode.typePeriode}}
                </h3>                                
            </div> 
            <div class="col-lg-12">         
                    {%for Phaseplan in list_phaseplan %}
                        <div class="panel panel-info">
                            <div class="panel-heading">{{ Phaseplan.phase.nomPhase }} - 
                            {% if Phaseplan.dateDebutPhase!= null %}
                                <td>Date de début: {{ Phaseplan.dateDebutPhase|date('d-m-Y') }} /</td>
                            {% else %}
                                <td> </td>
                            {% endif %}
                            {% if Phaseplan.dateFinPhase!= null %}
                                <td>Date de fin: {{ Phaseplan.dateFinPhase|date('d-m-Y') }} -</td>
                            {% else %}
                                <td> </td>
                            {% endif %}
                            <td><a href="{{ path('cnam_actiman_planProcedure_planifierPhase', {'idpha': Phaseplan.id}) }}">Planifier</a>
                            </div>                       
                            <div class="panel-body">   
                                <table class="table table-bordered table-hover tablesorter"> 
                                    <thead>
                                                <tr>
                                                    <th width="22%">Tache <i class="fa fa-sort"></i></th>
                                                    <th width="24%">Date de début <i class="fa fa-sort"></i></th>
                                                    <th width="26%">Date de fin <i class="fa fa-sort"></i></th>
                                                    <th width="16%">Agent <i class="fa fa-sort"></i></th>
                                                    <th width="12%"><center>Action <i class="fa fa-sort"></i></center></th>
                                                </tr>
                                    </thead>
                                            <tbody>
                                                {% for tache in list_tache %}
                                                {% if tache.Operation.phase == Phaseplan.phase %}
                                                <tr>
                                                    <td width="75%">{{tache.Operation.nomOperation}}</td>
                                                    {% if tache.dateDebutTheo!= null %}
                                                        <td>{{ tache.dateDebutTheo|date('d-m-Y') }}</td>
                                                    {% else %}
                                                        <td> </td>
                                                    {% endif %}
                                                    {% if tache.dateFinTheo!= null %}
                                                        <td>{{ tache.dateFinTheo|date('d-m-Y') }}</td>
                                                    {% else %}
                                                        <td> </td>
                                                    {% endif %}
                                                    {% if tache.user!= null %}
                                                        <td>{{ tache.user.nomUser }}</td>
                                                    {% else %}
                                                        <td> </td>
                                                    {% endif %} 
                                                    <td><center><a href="{{ path('cnam_actiman_planProcedure_planifierTache', {'idta': tache.id}) }}">Planifier</a> </center></td>
                                                </tr>                                                                                                      
                                                </tbody>                                             
                                        {% endif %}
                                    {% endfor %}     
                                </table>
                            </div> 
                        </div>                       
                    {% else %}
                        <h4>Pas de phase trouvée</h4>         
                    {% endfor %}
                </div>
        </div>         
    {% endblock%}
{% endblock%}
